export const showModal = ({content})=>{
    return new Promise((resolve, reject)=>{
         wx.showModal({
          title: '提示',
          content: content,
          success :(res) => {
            resolve(res);
          },
          fail:(err)=>{
            reject(err);
          }
        })
    })
}

export const showToast = (content) =>{
   return new Promise((resolve, reject)=>{
    wx.showToast({
      icon: 'none',
      image: '',
      duration: 1500,
      mask: false,
      ...content,
      success: (result)=>{
        resolve(result);
      },
      fail: (err)=>{
        reject(err);
      }
    });
   })
}

export const login = ()=>{
  return new Promise((resolve, reject)=>{
    wx.login({
      timeout:10000,
      success: (result) => {
        resolve(result);
      },
      fail: (err) => {
        reject(err);
      }
    });
  })
}